package string;

public class Test5 {
    public static void main(String[] args) {
        //给定下标,获取对应字符(注:下标从0开始)
        String s = "hello";
        System.out.println(s.charAt(0));
        System.out.println(s.charAt(1));
        System.out.println(s.charAt(2));
        System.out.println(s.charAt(3));
        System.out.println(s.charAt(4));
        String s2 = "中国";
        System.out.println(s2.charAt(0));
        System.out.println(s2.charAt(1));
    }
}
